REVERSE SOLUTION
public String reverse(String str)
{
if (str.isEmpty())
return str;
//Calling Function Recursively
return reverse(str.substring(1)) + str.charAt(0);
}IS PALINDROME SOLUTION
public boolean isPalindrome(String s)
{ // if length is 0 or 1 then String is palindrome
if(s.length() == 0 || s.length() == 1)
return true;
if(s.charAt(0) == s.charAt(s.length()-1))
return isPalindrome(s.substring(1, s.length()-1));
return false;
}SOME RECURSIVE SOLUTION
public boolean someRecursive(int[] arr, OddFunction odd) {
if (arr.length == 0 ) {
return false;
} else if (odd.run(arr[0]) == false) {
return someRecursive(Arrays.copyOfRange(arr, 1, arr.length), odd);
} else {
return true;
}
}FIRST UPPERCASE SOLUTION
static char first(String str)
{
for (int i = 0; i < str.length(); i++)
if (Character.isUpperCase(str.charAt(i)))
return str.charAt(i);
return 0;
}CAPITALIZE WORD SOLUTION
public static String capitalizeWord(String str){
String words[]=str.split("\\s");
String capitalizeWord="";
for(String w:words){
String first=w.substring(0,1);
String afterfirst=w.substring(1);
capitalizeWord+=first.toUpperCase()+afterfirst+" ";
}
return capitalizeWord.trim();
}